November 18, 2017

Iris Data

str(iris)
'data.frame':   150 obs. of  5 variables:
 $ Sepal.Length: num  5.1 4.9 4.7 4.6 5 5.4 4.6 5 4.4 4.9 ...
 $ Sepal.Width : num  3.5 3 3.2 3.1 3.6 3.9 3.4 3.4 2.9 3.1 ...
 $ Petal.Length: num  1.4 1.4 1.3 1.5 1.4 1.7 1.4 1.5 1.4 1.5 ...
 $ Petal.Width : num  0.2 0.2 0.2 0.2 0.2 0.4 0.3 0.2 0.2 0.1 ...
 $ Species     : Factor w/ 3 levels "setosa","versicolor",..: 1 1 1 1 1 1 1 1 1 1 ...

Interactive Plot - using plotly

In the next few slides we generate scatter plots of Petal.Length vs Sepal.Length using plotly and the following plot options:

  • set color equal to the factor variable Species
  • set color equal to the continuous variable Sepal.Width
  • scaling the size of the points in terms of Petal.Width

Colored using Species

Colored using Sepal.Width

Scaled using Petal.Width

Box-plot

3D Surface

Equations of the 3d surface above

\[\left[\begin{array}{c} x \\ y \\ z \end{array} \right] = \left[ \begin{array}{c} 2(1-e^u)\cos(u)\cos^2(v) \\ -2(1-e^u)\sin(u)\cos^2(v) \\ (1-e^u)(1-\sin(2v)) \end{array} \right]; \] \(0\leq u\leq 5\pi,0\leq v\leq 3\pi\)

The End!